<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />

<meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="author" content="Jørgen Bølstad, jorgen.bolstad@stv.uio.no" />


<title>Replication instructions for the article ‘Hierarchical Bayesian Aldrich-McKelvey Scaling’ in Political Analysis</title>

<script>// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
// be compatible with the behavior of Pandoc < 2.8).
document.addEventListener('DOMContentLoaded', function(e) {
  var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
  var i, h, a;
  for (i = 0; i < hs.length; i++) {
    h = hs[i];
    if (!/^h[1-6]$/i.test(h.tagName)) continue;  // it should be a header h1-h6
    a = h.attributes;
    while (a.length > 0) h.removeAttribute(a[0].name);
  }
});
</script>

<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
</style>



<style type="text/css">
code {
white-space: pre;
}
.sourceCode {
overflow: visible;
}
</style>
<style type="text/css" data-origin="pandoc">
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } 
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } 
code span.at { color: #7d9029; } 
code span.bn { color: #40a070; } 
code span.bu { color: #008000; } 
code span.cf { color: #007020; font-weight: bold; } 
code span.ch { color: #4070a0; } 
code span.cn { color: #880000; } 
code span.co { color: #60a0b0; font-style: italic; } 
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } 
code span.do { color: #ba2121; font-style: italic; } 
code span.dt { color: #902000; } 
code span.dv { color: #40a070; } 
code span.er { color: #ff0000; font-weight: bold; } 
code span.ex { } 
code span.fl { color: #40a070; } 
code span.fu { color: #06287e; } 
code span.im { color: #008000; font-weight: bold; } 
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } 
code span.kw { color: #007020; font-weight: bold; } 
code span.op { color: #666666; } 
code span.ot { color: #007020; } 
code span.pp { color: #bc7a00; } 
code span.sc { color: #4070a0; } 
code span.ss { color: #bb6688; } 
code span.st { color: #4070a0; } 
code span.va { color: #19177c; } 
code span.vs { color: #4070a0; } 
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } 
</style>
<script>
// apply pandoc div.sourceCode style to pre.sourceCode instead
(function() {
  var sheets = document.styleSheets;
  for (var i = 0; i < sheets.length; i++) {
    if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue;
    try { var rules = sheets[i].cssRules; } catch (e) { continue; }
    var j = 0;
    while (j < rules.length) {
      var rule = rules[j];
      // check if there is a div.sourceCode rule
      if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") {
        j++;
        continue;
      }
      var style = rule.style.cssText;
      // check if color or background-color is set
      if (rule.style.color === '' && rule.style.backgroundColor === '') {
        j++;
        continue;
      }
      // replace div.sourceCode by a pre.sourceCode rule
      sheets[i].deleteRule(j);
      sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
    }
  }
})();
</script>




<style type="text/css">body {
background-color: #fff;
margin: 1em auto;
max-width: 700px;
overflow: visible;
padding-left: 2em;
padding-right: 2em;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.35;
}
#TOC {
clear: both;
margin: 0 0 10px 10px;
padding: 4px;
width: 400px;
border: 1px solid #CCCCCC;
border-radius: 5px;
background-color: #f6f6f6;
font-size: 13px;
line-height: 1.3;
}
#TOC .toctitle {
font-weight: bold;
font-size: 15px;
margin-left: 5px;
}
#TOC ul {
padding-left: 40px;
margin-left: -1.5em;
margin-top: 5px;
margin-bottom: 5px;
}
#TOC ul ul {
margin-left: -2em;
}
#TOC li {
line-height: 16px;
}
table {
margin: 1em auto;
border-width: 1px;
border-color: #DDDDDD;
border-style: outset;
border-collapse: collapse;
}
table th {
border-width: 2px;
padding: 5px;
border-style: inset;
}
table td {
border-width: 1px;
border-style: inset;
line-height: 18px;
padding: 5px 5px;
}
table, table th, table td {
border-left-style: none;
border-right-style: none;
}
table thead, table tr.even {
background-color: #f7f7f7;
}
p {
margin: 0.5em 0;
}
blockquote {
background-color: #f6f6f6;
padding: 0.25em 0.75em;
}
hr {
border-style: solid;
border: none;
border-top: 1px solid #777;
margin: 28px 0;
}
dl {
margin-left: 0;
}
dl dd {
margin-bottom: 13px;
margin-left: 13px;
}
dl dt {
font-weight: bold;
}
ul {
margin-top: 0;
}
ul li {
list-style: circle outside;
}
ul ul {
margin-bottom: 0;
}
pre, code {
background-color: #f7f7f7;
border-radius: 3px;
color: #333;
white-space: pre-wrap; 
}
pre {
border-radius: 3px;
margin: 5px 0px 10px 0px;
padding: 10px;
}
pre:not([class]) {
background-color: #f7f7f7;
}
code {
font-family: Consolas, Monaco, 'Courier New', monospace;
font-size: 85%;
}
p > code, li > code {
padding: 2px 0px;
}
div.figure {
text-align: center;
}
img {
background-color: #FFFFFF;
padding: 2px;
border: 1px solid #DDDDDD;
border-radius: 3px;
border: 1px solid #CCCCCC;
margin: 0 5px;
}
h1 {
margin-top: 0;
font-size: 35px;
line-height: 40px;
}
h2 {
border-bottom: 4px solid #f7f7f7;
padding-top: 10px;
padding-bottom: 2px;
font-size: 145%;
}
h3 {
border-bottom: 2px solid #f7f7f7;
padding-top: 10px;
font-size: 120%;
}
h4 {
border-bottom: 1px solid #f7f7f7;
margin-left: 8px;
font-size: 105%;
}
h5, h6 {
border-bottom: 1px solid #ccc;
font-size: 105%;
}
a {
color: #0033dd;
text-decoration: none;
}
a:hover {
color: #6666ff; }
a:visited {
color: #800080; }
a:visited:hover {
color: #BB00BB; }
a[href^="http:"] {
text-decoration: underline; }
a[href^="https:"] {
text-decoration: underline; }

code > span.kw { color: #555; font-weight: bold; } 
code > span.dt { color: #902000; } 
code > span.dv { color: #40a070; } 
code > span.bn { color: #d14; } 
code > span.fl { color: #d14; } 
code > span.ch { color: #d14; } 
code > span.st { color: #d14; } 
code > span.co { color: #888888; font-style: italic; } 
code > span.ot { color: #007020; } 
code > span.al { color: #ff0000; font-weight: bold; } 
code > span.fu { color: #900; font-weight: bold; } 
code > span.er { color: #a61717; background-color: #e3d2d2; } 
</style>




</head>

<body>




<h1 class="title toc-ignore">Replication instructions for the article
‘Hierarchical Bayesian Aldrich-McKelvey Scaling’ in <i>Political
Analysis</i></h1>
<h4 class="author">Jørgen Bølstad, <a href="mailto:jorgen.bolstad@stv.uio.no" class="email">jorgen.bolstad@stv.uio.no</a></h4>



<div id="working-directory" class="section level2">
<h2>Working directory</h2>
<p>To use these replication files, R’s working directory should be set
to the <code>R/</code> folder in the replication package, for instance
by using <code>setwd()</code>.</p>
</div>
<div id="installing-the-r-package" class="section level2">
<h2>Installing the R package</h2>
<p>The article is accompanied by an R package called
<strong>hbamr</strong>, which needs to be installed before the
replication files can be run.</p>
<p>The package requires that <strong>rstan</strong> is installed first,
and instructions for doing so are available <a href="https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started">here</a>.
As explained in these instructions, you need to configure your R
installation to be able to compile C++ code and you can significantly
improve the estimation speed of the models by following the advice on
optimizing compiler usage.</p>
<p>Having installed <strong>rstan</strong>, the <strong>hbamr</strong>
package can be installed using the line below. All models will be
compiled upon installation, which means the process will take a few
minutes.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">install.packages</span>(<span class="st">&quot;../package/hbamr_1.0.1.tar.gz&quot;</span>, <span class="at">repos =</span> <span class="cn">NULL</span>, <span class="at">type =</span> <span class="st">&quot;source&quot;</span>)</span></code></pre></div>
<p>Future users of <strong>hbamr</strong> should install a current
version, rather than using the one included in the replication material.
The package is expected to be available on CRAN by the time the article
is published. It is also available on GitHub: <a href="https://github.com/jbolstad/hbamr" class="uri">https://github.com/jbolstad/hbamr</a>.</p>
</div>
<div id="files-to-replicate-results-for-the-empirical-application-in-the-article" class="section level2">
<h2>Files to replicate results for the empirical application in the
article</h2>
<p>The replication package does not include a master file, because one
of the files comes with a heavy computational load and should probably
not be run in its current form on a normal computer. However, the
following two files have reasonable computational demands and will
replicate all tables and figures that are reported in the article,
except Figures 7 and 8 (which report Monte Carlo simulations):</p>
<ul>
<li><code>fit_models.R</code>
<ul>
<li>This code fits the models reported in the empirical application
section in the article.</li>
<li>It will save model fits totaling ca. <strong>6 GB</strong> in the
folder <code>../results/</code>.</li>
<li>It takes about <strong>24-32 hours</strong> to run on a computer
with 6 CPU cores (see Computer 2, below).</li>
<li>The code runs HMC chains in parallel and uses the
<code>parallel</code> package to detect the number of physical CPU cores
on the system. Standard model fitting via the <code>hbam()</code>
function will use up to 4 cores, while cross-validation via
<code>hbam_cv()</code> will use up to 20 cores if available. In short,
the cross-validation (which is the most time consuming) <u>will benefit
from having access to a high number of cores</u>.</li>
</ul></li>
<li><code>report_results.R</code>
<ul>
<li>This file produces the figures and tables that report results for
the empirical application: Figures 1-6, and Tables 1 and 2.</li>
<li>It also produces some supplementary material: Figures S1 and S2, and
Tables S1-S3.</li>
<li>The computational requirements small: The code should finish within
15 minutes on a normal computer.</li>
</ul></li>
</ul>
<p>To replicate all results in the article, except Figures 7 and 8, one
could run:</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="fu">source</span>(<span class="st">&quot;fit_models.R&quot;</span>, <span class="at">echo =</span> <span class="cn">TRUE</span>)</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="fu">source</span>(<span class="st">&quot;report_results.R&quot;</span>, <span class="at">echo =</span> <span class="cn">TRUE</span>)</span></code></pre></div>
</div>
<div id="files-to-replicate-the-monte-carlo-study-in-the-article" class="section level2">
<h2>Files to replicate the Monte Carlo study in the article</h2>
<p>The article reports a Monte Carlo study that is computationally
demanding to replicate in full. However, one can save time by
replicating a subset of the results. The relevant files are as
follows:</p>
<ul>
<li><code>run_sims.R</code>
<ul>
<li>This is the most computationally demanding file in this replication
package: It fits three Stan models to 6000 simulated datasets.</li>
<li>The output is stored in <code>../results/sim_res.Rda</code> and is
only 1.2 MB.</li>
<li>It takes about <strong>3.5 days to run on a computer with 64 slow
CPU cores</strong> (see Computer 1, below): <u>It should only be run in
its current form on a high-performance computing system</u>.</li>
<li>The code runs HMC chains in parallel and will benefit from having
access to a high number of CPU cores – <u>the code will in theory use up
to 6000 cores if available.</u></li>
<li><u>To reduce the computational requirements, one could reduce the
<code>nreps</code> argument</u> given to the function
<code>run_para_sims</code> in this R file: <code>nreps</code> is
currently set to 10, which yields 6000 simulated datasets in total.
Setting <code>nreps = 1</code> would cut the computational load by 90%
and result in 600 simulated results per model. This will obviously not
replicate the plots reported in the paper, but it will replicate the
first 600 simulation results (stored in
<code>../results/sim_res.Rda</code>) and thereby verify that the code
works and that it will produce the reported results if
<code>nreps</code> is set to 10.</li>
<li>One could run this file as follows:</li>
</ul></li>
</ul>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">source</span>(<span class="st">&quot;run_sims.R&quot;</span>, <span class="at">echo =</span> <span class="cn">TRUE</span>)</span></code></pre></div>
<ul>
<li><code>run_sims_limited.R</code>
<ul>
<li>This file offers a scaled-down alternative to
<code>run_sims.R</code>. It replicates only the first six rows of the
complete set of simulation results, using six CPU cores if
available.</li>
<li>It stores these results as
<code>../results/sim_res_subset.Rda</code>.</li>
<li>The file also contains a couple of lines to compare the first six
rows of the replicated subset to the complete set of results. (As
explained in the section below on “Limits to exact replication”, one
cannot expect an <em>exact</em> replication of the simulation results
when running the code on a different system, but the differences are
substantively negligible.)</li>
<li>The computational demands of this file are small. It takes
<strong>20 minutes</strong> on a computer with 6 CPU cores (see Computer
2, below).</li>
<li>One could run this file as follows:</li>
</ul></li>
</ul>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">source</span>(<span class="st">&quot;run_sims_limited.R&quot;</span>, <span class="at">echo =</span> <span class="cn">TRUE</span>)</span></code></pre></div>
<ul>
<li><code>report_sim_results.R</code>
<ul>
<li>This file produces the figures that report simulation results:
Figures 7 and 8.</li>
<li>It also produces some supplementary material: Figures S1 and
S2.</li>
<li>The computational requirements are small: The code should finish
within a few minutes on a normal computer.</li>
<li>One could run this file as follows:</li>
</ul></li>
</ul>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">source</span>(<span class="st">&quot;report_sim_results.R&quot;</span>, <span class="at">echo =</span> <span class="cn">TRUE</span>)</span></code></pre></div>
</div>
<div id="files-to-replicate-supplementary-material" class="section level2">
<h2>Files to replicate supplementary material</h2>
<p>The following files run analyses that are only reported as
supplementary material. <u>Running these files is not necessary for
replicating the analyses reported in the article:</u></p>
<ul>
<li><code>fit_models_anes1980.R</code>
<ul>
<li>This code fits the models to the ANES 1980 dataset.</li>
<li>It will save model fits totaling ca. <strong>2 GB</strong> in the
folder <code>../results/</code>.</li>
<li>It takes about <strong>3 hours</strong> to run on a computer with 6
CPU cores (see Computer 2, below).</li>
<li>The code runs HMC chains in parallel and uses the
<code>parallel</code> package to detect the number of physical CPU cores
on the system. Standard model fitting via the <code>hbam()</code>
function will use up to 4 cores, while cross-validation via
<code>hbam_cv()</code> will use up to 20 cores if available. In short,
the cross-validation (which is the most time consuming) <u>will benefit
from having access to a high number of cores.</u></li>
</ul></li>
<li><code>report_results_anes1980.R</code>
<ul>
<li>This file produces figures and tables reported as supplementary
material: Figures S3 and S4, and Tables S4-S10.</li>
<li>The computational requirements small: The code should finish within
15 minutes on a normal computer.</li>
</ul></li>
</ul>
<p>To replicate remaining tables and figures that are reported as
supplementary material, one could run:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="fu">source</span>(<span class="st">&quot;fit_models_anes1980.R&quot;</span>, <span class="at">echo =</span> <span class="cn">TRUE</span>)</span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="fu">source</span>(<span class="st">&quot;report_results_anes1980.R&quot;</span>, <span class="at">echo =</span> <span class="cn">TRUE</span>)</span></code></pre></div>
</div>
<div id="limits-to-exact-replication" class="section level2">
<h2>Limits to exact replication</h2>
<p>These replication files set seeds for all operations that involve a
random number generator. This is sufficient to get the exact same
results in repeated runs on the same system, but it <u>does not ensure
exact replication across systems or software versions.</u> The <a href="https://mc-stan.org/docs/reference-manual/reproducibility.html">Stan
Reference Manual</a> explains why:</p>
<blockquote>
<p>Floating point operations on modern computers are notoriously
difficult to replicate because the fundamental arithmetic operations,
right down to the IEEE 754 encoding level, are not fully specified. The
primary problem is that the precision of operations varies across
different hardware platforms and software implementations.</p>
<p>Stan is designed to allow full reproducibility. However, this is only
possible up to the external constraints imposed by floating point
arithmetic.</p>
<p>Stan results will only be exactly reproducible if <em>all</em> of the
following components are <em>identical</em>:</p>
<ul>
<li>Stan version</li>
<li>Stan interface (RStan, PyStan, CmdStan) and version, plus version of
interface language (R, Python, shell)</li>
<li>versions of included libraries (Boost and Eigen)</li>
<li>operating system version</li>
<li>computer hardware including CPU, motherboard and memory</li>
<li>C++ compiler, including version, compiler flags, and linked
libraries</li>
<li>same configuration of call to Stan, including random seed, chain ID,
initialization and data</li>
</ul>
</blockquote>
<p>In short, running these replication files on a different system will
likely yield slightly different results from those reported in the
article. In fact, Computers 1 and 2 listed below do not yield the exact
same results even when the same seeds are supplied to each system. It
should be noted, however, that <u>the differences across systems are
very small and substantively negligible.</u></p>
</div>
<div id="data-availability" class="section level2">
<h2>Data availability</h2>
<p>The article reports analyses of the Americal National Election Study
(ANES) 2012, while the supplementary material include analyses of ANES
1980. The original datasets are available from <a href="https://electionstudies.org" class="uri">https://electionstudies.org</a> upon registration. However,
the ANES 2012 dataset that is used here was obtained from the
replication material for Hare et al.’s article (2015), while ANES 1980
dataset comes from the R package basicspace (Poole et al. 2016). Minimal
versions of both datasets (containing only key variables) are included
in the <strong>hbamr</strong> package and can be loaded by running
<code>data(&quot;LC2012&quot;)</code> and <code>data(&quot;LC1980&quot;)</code> after the
package has been attached.</p>
</div>
<div id="computers" class="section level2">
<h2>Computers</h2>
<p>Two different computers have been used to run the reported
analyses:</p>
<ol style="list-style-type: decimal">
<li><p>An ARM based server running Linux. This system has a Kunpeng
916/Hi1616 CPU with 64 cores running at up to 2.4 GHz. It has 256 GB of
memory.</p></li>
<li><p>A Mac Mini (2018) running MacOS 13.1. This system has an Intel
Core i7 CPU with 6 cores running at 3.2-4.6 GHz. It has 16 GB of
memory.</p></li>
</ol>
</div>
<div id="session-info" class="section level2">
<h2>Session info</h2>
<p>Computer 2 (which is able to run the complete replication codes) has
the following session info:</p>
<pre><code>R version 4.2.2 (2022-10-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Ventura 13.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] reshape2_1.4.4 ggplot2_3.4.0  tidyr_1.3.0    xtable_1.8-4   hbamr_1.0.1   

loaded via a namespace (and not attached):
 [1] rstan_2.21.8         tidyselect_1.2.0     xfun_0.36            purrr_1.0.1         
 [5] colorspace_2.1-0     vctrs_0.5.2          generics_0.1.3       htmltools_0.5.4     
 [9] stats4_4.2.2         loo_2.5.1            yaml_2.3.6           utf8_1.2.3          
[13] rlang_1.0.6          pkgbuild_1.4.0       pillar_1.8.1         glue_1.6.2          
[17] withr_2.5.0          RColorBrewer_1.1-3   matrixStats_0.63.0   lifecycle_1.0.3     
[21] plyr_1.8.8           stringr_1.5.0        munsell_0.5.0        gtable_0.3.1        
[25] codetools_0.2-18     evaluate_0.20        inline_0.3.19        knitr_1.41          
[29] callr_3.7.3          fastmap_1.1.0        ps_1.7.2             parallel_4.2.2      
[33] fansi_1.0.4          pbmcapply_1.5.1      rstantools_2.2.0     Rcpp_1.0.10         
[37] scales_1.2.1         RcppParallel_5.1.6   StanHeaders_2.21.0-7 gridExtra_2.3       
[41] digest_0.6.31        stringi_1.7.12       processx_3.8.0       dplyr_1.1.0         
[45] grid_4.2.2           cli_3.6.0            tools_4.2.2          magrittr_2.0.3      
[49] tibble_3.1.8         crayon_1.5.2         pkgconfig_2.0.3      prettyunits_1.1.1   
[53] rmarkdown_2.19       rstudioapi_0.14      R6_2.5.1             compiler_4.2.2      </code></pre>
</div>



<!-- code folding -->


<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
  (function () {
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src  = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
    document.getElementsByTagName("head")[0].appendChild(script);
  })();
</script>

</body>
</html>
